package com.good.msgsys.entity.response;

import com.good.msgsys.entity.User;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @author junlong
 * @date 2021/1/5 17:57
 */
@ApiModel("用户信息")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserInfo {
    @ApiModelProperty("用户id")
    private String id;
    @ApiModelProperty("用户角色：0系统管理员，1主管，2员工")
    private Integer role;
    @ApiModelProperty("账号")
    private String account;
    @ApiModelProperty("工号")
    private String num;
    @ApiModelProperty("姓名")
    private String name;
    @ApiModelProperty("职位")
    private String job;
    @ApiModelProperty("学校")
    private String school;
    @ApiModelProperty("入职时间")
    private Date joinTime;
    @ApiModelProperty("生日")
    private Date birthday;
    @ApiModelProperty("电话")
    private String phone;
    @ApiModelProperty("政治面貌：共产党员，1共青团员，2群众")
    private Integer political;
    @ApiModelProperty("性别：0男，1女")
    private Integer gender;
    @ApiModelProperty("学位：0博士，1硕士，2学士，3其他")
    private Integer degree;
    @ApiModelProperty("邮箱")
    private String email;
    @ApiModelProperty("学历：0研究生，1大学，高中，初中")
    private Integer education;
    @ApiModelProperty("地址")
    private String address;
    @ApiModelProperty("用户创建时间")
    private Date createTime;
    @ApiModelProperty("用户状态：0已删除，1正常")
    private Integer state;

    public UserInfo(User user) {
        this.id = user.getId();
        this.role = user.getRole();
        this.account = user.getAccount();
        this.num = user.getNum();
        this.name = user.getName();
        this.job = user.getJob();
        this.school = user.getSchool();
        this.joinTime = user.getJoinTime();
        this.birthday = user.getBirthday();
        this.phone = user.getPhone();
        this.political = user.getPolitical();
        this.gender = user.getGender();
        this.degree = user.getDegree();
        this.email = user.getEmail();
        this.education = user.getEducation();
        this.address = user.getAddress();
        this.createTime = user.getCreateTime();
        this.state = user.getState();
    }
}
